<?python
  
    from fasttrack.utils import fmt, textilize, getGroups
    from fasttrack.model import impact_codes
    from turbogears import identity

    user_person = identity.current.user
    groupids = getGroups()

    def get_class(issue):
        if issue.closed: return "closed"
        else: return ""

?>

<tr xmlns:py="http://purl.org/kid/ns#" id="issue_$issue.id" class="${get_class(issue)}">
	<td py:if="read_only or (user_person != issue.creator and (not 'admin' in groupids))">${impact_codes[issue.impact]}</td>
	<td py:if="not read_only and (user_person == issue.creator or 'admin' in groupids)">
		<select id="issue_impact_$issue.id" name="impact" onchange="modify_issue($issue.id)">
			<option py:for="key, description in impact_codes.items()" value="$key" selected="${(None, '')[key == issue.impact]}">
				${description}
			</option>
		</select>
	</td>
	<td>${issue.issue}</td>
	<td>
		<a href="mailto:$issue.creator.emailAddress">${issue.creator.displayName}</a>
	</td>
	<td>${fmt(issue.creation_date)}</td>
	<td py:if="not read_only">
		<a href="#" onclick="close_issue($issue.id); return false;">X</a>
	</td>
</tr>